OpenGL ES 2 for Android (for Jan S Morrison) by Kevin Brothaler

OpenGL ES 2 for Android (for Jan S Morrison) by Kevin Brothaler

Author:Kevin Brothaler
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 978-1-937785-34-5
Publisher: The Pragmatic Bookshelf, LLC (436473)


​ ​void​ main()

​ {

​ gl_FragColor = u_Color;

​ }

Our shaders should now be up-to-date.

8.6 Integrating Our Changes

The hardest part of this chapter is done. We learned how to build a puck and a mallet out of simple geometric shapes, and we’ve also updated our shaders to reflect the changes. All that’s left is to integrate the changes into ​AirHockeyRenderer​; at the same time, we’ll also learn how to add the concept of a camera by adding a view matrix.

So why would we want to add another matrix? When we first started our air hockey project, we originally didn’t use any matrices at all. We first added an orthographic matrix to adjust for the aspect ratio, and then we switched to a perspective matrix to get a 3D projection. We then added a model matrix to start moving stuff around. A view matrix is really just an extension of a model matrix; it’s used for the same purposes, but it applies equally to every object in the scene.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.